#include <bits/stdc++.h>
using namespace std;

#define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

typedef long long LL;

const int N = 105;

int dp[N][N][26];

char s[N];

int a[N];

int n;

void update(int &a, int b)
{
	a = max(a, b);
}


bool vis[N];
int findadj(int i)
{
	int j = i-1;
	while (j >= 0 && vis[j]) --j;
	if (~j && a[j] + 1 == a[i])
		return j;
	j = i+1;
	while (j < n && vis[j]) ++j;
	if (j < n && a[j] + 1 == a[i])
		return j;
	dbg(i);
	return -1;
}

int main(int argc, char const *argv[])
{
	scanf("%d", &n);
	scanf("%s", s); 
	bool update = true;
	for (int i=0; i<n; ++i)
		a[i] = s[i] - 'a';
	int Ans = 0;
	while (update)
	{
		update = false;
		dbg("FUCK");
		int fd = -1, ans = -1;
		for (int i=0; i<n; ++i)
		{
			if (vis[i]) continue;
			int tans = findadj(i);
			if (tans != -1 && s[i] > fd)
			{
				dbg("FUCK");
				update = true;
				fd = s[i];
				ans = i;
			}
		}
		if (update) {
			++Ans;
			vis[ans] = 1;
		}
	}

	printf("%d\n", Ans);
	return 0;
}